package com.dayuanit.booksystem.v4.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 页面跳转的servlet
 */
public class PageServlet extends BaseServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String pageName = req.getParameter("pageName");

        req.setAttribute("currentPage", 1);
        req.setAttribute("totalPage", 1);
        //服务器内部跳转
        req.getRequestDispatcher("/WEB-INF/page/v3/" + pageName).forward(req, resp);

//        resp.sendRedirect("/WEB-INF/page/v3/" + pageName);

        //重定向
//        resp.sendRedirect("http://wwww.taobao.com");
    }
}
